<template>
  <div>
    <AddComponents @add="handleAdd" />
    {{ menuArr }}
    <ListComponents :menu-list="menuArr" @delete="handleDelete" />
  </div>
</template>
<script setup>
import { ref } from "vue";
import AddComponents from "./components/新增.vue";
import ListComponents from "./components/列表.vue";

const menuArr = ref([]);
const handleAdd = (addString) => {
  menuArr.value.push(addString);
};
const handleDelete = (index) => {
  menuArr.value.splice(index, 1);
};
</script>
<style></style>
